package day9;

import java.util.Scanner;


//走方格的方案数
public class oj2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int n = in.nextInt();
            int m = in.nextInt();
            System.out.println(num(n,m));
        }
    }
    public static int num(int n,int m) {
        if((n == 1 && m >= 1) || (m == 1 && n >=1)) {
            return m + n;
        }

        return num(n - 1,m) + num(n,m -1);
    }
}
